<?php
	include_once('header.php');
	include_once('menu.php');
	include_once('content.php');
?>

<h3>Výsledky vyhľadávania </h3>

<table cellpadding="0" cellspacing="0">
<?php
if ($_GET['menotabulky']=='people') {
	
foreach ($vysledky as $key => $obj) {
?>

<tr>
    <td><?php echo anchor('people/ukaz/'.$obj['person_id'], $obj['surname'].' '.$obj['name']); ?></td>
    <td class="action">
    	<?php if($this->session->userdata('logged_in') && $this->session->userdata('admin')){ ?>
    	<?php echo anchor('people/upgrade/'.$obj['person_id'],'Zmeň',array('class'=>'edit')); ?>
    	<?php } ?>
    	&nbsp;
    </td>
</tr>

<?php
} //end foreach
}
elseif ($_GET['menotabulky']=='pricestovani') {
	foreach ($vysledky as $key => $obj) {
?>


		<tr>
	        <td><?php echo anchor('SluzobneCesty/ukaz/pricestovani/'.$obj['id'], $obj['country'].'-'.$obj['city']); ?></td>
	        <td class="action">
	        	<?php if($this->session->userdata('logged_in') && $this->session->userdata('admin')){  ?>
	        	<?php echo anchor('SluzobneCesty/zmenCestu/pricestovani/'.$obj['id'],'Zmeň',array('class'=>'edit')); ?>
	        	<?php echo anchor('SluzobneCesty/delete/pricestovani/'.$obj['id'], 'Zrušiť',array('class'=>'delete', 'onclick'=>'return confirm(\'Naozaj si prajete vymazať cestu?\')')); ?>
	        	<?php } ?>
	        	&nbsp;
	        </td>
	    </tr>

<?php	
	}
}
else {
	foreach ($vysledky as $key => $obj) {
?>


		<tr>
	        <td><?php echo anchor('SluzobneCesty/ukaz/odcestovani/'.$obj['id'], $obj['country'].'-'.$obj['city']); ?></td>
	        <td class="action">
	        	<?php if($this->session->userdata('logged_in') && $this->session->userdata('admin')){?>
	        	<?php echo anchor('SluzobneCesty/zmenCestu/odcestovani/'.$obj['id'],'Zmeň',array('class'=>'edit')); ?>
	        	<?php echo anchor('SluzobneCesty/delete/odcestovani/'.$obj['id'], 'Zrušiť',array('class'=>'delete', 'onclick'=>'return confirm(\'Naozaj si prajete vymazať cestu?\')')); ?>
	        	<?php } ?>
	        	&nbsp;
	        </td>
	    </tr>

<?php	
	}
}
?>
</table>




<?php
	include_once('footer.php');
?>